<?php
/**
 * User: 苏翔
 * Date: 2024/8/11 12:52
 */

namespace App;

/**
 * 奖池配置类，用于定义奖池相关配置常量及描述
 */
class FundConf
{
    const STATUS_ENABLED = 1;
    const STATUS_DISABLED = 0;
    // 奖池类型的文本描述
    const STATUS_FIX_CANCEL = -4;

    // 奖池日志状态常量：正常、取消、对冲（取消后补偿）
    const STATUS_FIX_UNDO_CANCEL = -8;


    const CATEGORY_INCOME_ORDER_PROFIT = 1;
    const CATEGORY_INCOME_BLIND_PURCHASE_RAFFLE_PROFIT = 2;
    const CATEGORY_INCOME_REBATE_PROFIT = 3;
    const CATEGORY_INCOME_PIN_GOU_PROFIT = 4;
    const CATEGORY_INCOME_CASH_WITHDRAWAL_FEE = 5;
    const CATEGORY_INCOME_COMMISSION_WITHDRAWAL_FEE = 6;
    const CATEGORY_INCOME_EXCHANGE_NOW_MONEY = 7;
    const CATEGORY_INCOME_EXCHANGE_INTEGRAL = 8;
    const CATEGORY_EXPENSE_COMMISSION_EXPENSE = -1;
    const CATEGORY_EXPENSE_DEALER_BONUS = -2;
    const CATEGORY_EXPENSE_HSCOIN_EXCHANGE_POINTS = -3;
    const CATEGORY_EXPENSE_HSCOIN_EXCHANGE_BALANCE = -4;
    const CATEGORY_EXPENSE_CASH_BLIND_BOX_EXPENSE = -5;
    const CATEGORY_EXPENSE_PIN_GOU_BONUS_EXPENSE = -6;
    const CATEGORY_EXPENSE_REBATE_CASHBACK_EXPENSE = -7;
    const CATEGORY_EXPENSE_REBATE_AD_TASK = -8;
    const CATEGORY_EXPENSE_REBATE_INVITE_TASK = -9;
    const FUND_COUNT_CACHE_TYPE_BALANCE = 9;
    const FUND_COUNT_CACHE_TYPE_CATEGORY_INCOME = 1;
    const FUND_COUNT_CACHE_TYPE_CATEGORY_EXPENSE = -1;
    /**
     * @var string[] 奖池状态描述 ，前两个状态CRMEB默认状态，后面为log状态
     */
    static array $statusDesc = [
        self::STATUS_ENABLED => '正常/启用',
        self::STATUS_DISABLED => '取消/禁用',
        self::STATUS_FIX_CANCEL => '取消对冲',// 取消后补偿统计和余额
        self::STATUS_FIX_UNDO_CANCEL => '恢复对冲',// 取消后补偿统计和余额
    ];
    /**
     * @var string[] 奖池收入分类描述 ，可以用户□订单利润
     */
    static array $categoryIncomeLabelMap = [
        self::CATEGORY_INCOME_ORDER_PROFIT => '订单利润',
        self::CATEGORY_INCOME_BLIND_PURCHASE_RAFFLE_PROFIT => '盲购抽奖利润',
        self::CATEGORY_INCOME_REBATE_PROFIT => '回米购利润',
        self::CATEGORY_INCOME_PIN_GOU_PROFIT => '拼购利润',
        self::CATEGORY_INCOME_CASH_WITHDRAWAL_FEE => '现金提现手续费',
        self::CATEGORY_INCOME_COMMISSION_WITHDRAWAL_FEE => '佣金提现手续费',
        self::CATEGORY_INCOME_EXCHANGE_NOW_MONEY => '金豆兑换现金手续费',
        self::CATEGORY_INCOME_EXCHANGE_INTEGRAL => '金豆兑换积分手续费',
    ];
    /**
     * @var string[] 奖池收入分类描述 ，可以用户□订单利润
     */
    static array $categoryIncomeFieldMap = [
        self::CATEGORY_INCOME_ORDER_PROFIT => 'income_order_profit',
        self::CATEGORY_INCOME_BLIND_PURCHASE_RAFFLE_PROFIT => 'income_blind_purchase_raffle_profit',
        self::CATEGORY_INCOME_REBATE_PROFIT => 'income_rebate_profit',
        self::CATEGORY_INCOME_PIN_GOU_PROFIT => 'income_pin_gou_profit',
        self::CATEGORY_INCOME_CASH_WITHDRAWAL_FEE => 'income_cash_withdrawal_fee',
        self::CATEGORY_INCOME_COMMISSION_WITHDRAWAL_FEE => 'income_commission_withdrawal_fee',
        self::CATEGORY_INCOME_EXCHANGE_NOW_MONEY => 'income_exchange_now_money',
        self::CATEGORY_INCOME_EXCHANGE_INTEGRAL => 'income_exchange_integral',
    ];
    /**
     * @var string[] 奖池支出分类描述□佣金支出
     */
    static $categoryExpenseLabelMap = [
        self::CATEGORY_EXPENSE_COMMISSION_EXPENSE => '佣金支出',
        self::CATEGORY_EXPENSE_DEALER_BONUS => '经销商分红',
        self::CATEGORY_EXPENSE_HSCOIN_EXCHANGE_POINTS => '睡宝金豆兑换积分',
        self::CATEGORY_EXPENSE_HSCOIN_EXCHANGE_BALANCE => '睡宝金豆兑换余额',
        self::CATEGORY_EXPENSE_CASH_BLIND_BOX_EXPENSE => '现金盲盒支出',
        self::CATEGORY_EXPENSE_PIN_GOU_BONUS_EXPENSE => '拼购奖金支出',
        self::CATEGORY_EXPENSE_REBATE_CASHBACK_EXPENSE => '回米购返现支出',
        self::CATEGORY_EXPENSE_REBATE_AD_TASK => '回米购广告任务',
        self::CATEGORY_EXPENSE_REBATE_INVITE_TASK => '回米购邀请任务',
    ];
    /**
     * @var string[] 奖池支出分类描述□佣金支出
     */
    static $categoryExpenseFieldMap = [
        self::CATEGORY_EXPENSE_COMMISSION_EXPENSE => 'expense_commission_expense',
        self::CATEGORY_EXPENSE_DEALER_BONUS => 'expense_dealer_bonus',
        self::CATEGORY_EXPENSE_HSCOIN_EXCHANGE_POINTS => 'expense_hscoin_exchange_points',
        self::CATEGORY_EXPENSE_HSCOIN_EXCHANGE_BALANCE => 'expense_hscoin_exchange_balance',
        self::CATEGORY_EXPENSE_CASH_BLIND_BOX_EXPENSE => 'expense_cash_blind_box_expense',
        self::CATEGORY_EXPENSE_PIN_GOU_BONUS_EXPENSE => 'expense_pin_gou_bonus_expense',
        self::CATEGORY_EXPENSE_REBATE_CASHBACK_EXPENSE => 'expense_rebate_cashback_expense',
        self::CATEGORY_EXPENSE_REBATE_AD_TASK => 'expense_rebate_ad_task',
        self::CATEGORY_EXPENSE_REBATE_INVITE_TASK => 'percent_rebate_invite_task',
    ];
    /**
     * @var string[]
     */
    static $categoryRateFieldMap = [
        self::CATEGORY_INCOME_REBATE_PROFIT => 'income_rebate_profit_percent',//回米购比例
        self::CATEGORY_INCOME_ORDER_PROFIT => 'income_order_profit_percent',// 众创抽取订单比例
        self::CATEGORY_INCOME_BLIND_PURCHASE_RAFFLE_PROFIT => 'income_blind_purchase_raffle_profit_percent',// 盲购比例
        self::CATEGORY_INCOME_PIN_GOU_PROFIT => 'income_pin_gou_profit_percent',// 拼购比例
    ];
    /**
     * @var string[]
     */
    static $fundCountCacheNote = [
        self::FUND_COUNT_CACHE_TYPE_BALANCE => '余额',
        self::FUND_COUNT_CACHE_TYPE_CATEGORY_INCOME => '分类收入',
        self::FUND_COUNT_CACHE_TYPE_CATEGORY_EXPENSE => '分类支出',
    ];
    const HSCOIN_BALANCE_CACHE_KEY= 'hscoin_balance';
    const HSCOIN_CACHE_LIFE_TIME = 60;

    const CHECK_HANDLED_BILL_NUM=1000;
}
